var webpack = require('webpack')
var path = require('path')

module.exports = {

    entry: {
        pageA:'./src/pageA',
        pageA2:'./src/pageA2'
    },

    output: {
        // path:path.resolve(_dirname,'./dist'),  //_dirname 当前目录
        filename: '[name].js',
        chunkFilename: '[name].chunk.js'
    },

    optimization: {
        //New chunk would be bigger than 30kb (before min+gz)！真的吐血
        // runtimeChunk: {
        //     name: 'runtime'
        //   },
        splitChunks: {
            chunks: 'initial',
            minChunks: 1,
            name: 'common',
            cacheGroups: {
                commons: {
                  chunks: 'initial',
                  minChunks:1,
                  name: 'vendors',
                }
              }
        },
    },
    plugins: [],
    module: {}
}